-- tail call example

tail = function(stop)
    f = function(i)
        if i < stop then
            if i % 10000 == 0 then
                print(i)
            end
            --local x =  f(i + 1) 
            --return x
            return f(i + 1)
        end
    end
    f(0)
end

tail(1000000)

